package org.lsc.summercontroller;

import javax.annotation.PostConstruct;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author 刘事成
 * @Description:
 * @date 2018/9/18 9:34
 */
public class Test {

    public static void main(String[] args) {
        Pattern p = Pattern.compile("\\d{1,4}");
        Matcher m = p.matcher("2223");
        System.out.println(" end:"+m.matches());
        while(m.find()) {
            System.out.println(m);
            System.out.println(m.group());
            System.out.print("start:"+m.start());
            System.out.println(" end:"+m.end());

        }
        String s = "";

    }
}
